<template>
	<view class="center">
		<!-- <view class="header">
			<view class="arrow" @tap="$back()">
				<image class="lefts" style="width: 20rpx;height: 40rpx;" src="../../../static/images/arrow_left.png" mode="aspectFit"></image>
			</view>
			<view class="tit f36 cfff">
				<text>仓库选择</text>
			</view>
			<view class="btn f32 cfff btn-plain-primary btn-radius">
				<text>清除</text>
				<text ></text>
			</view>
		</view> -->
		<hea-ders title="仓库选择">
			<image class="left" slot='left' src="@/static/images/arrow_left.png" mode="widthFix" @click="back"></image>
			<text class="text" slot='official'>清除</text>
			<text class="text" slot='official'@tap="$open('../warehousEdit/warehousEdit')">新增</text>
		</hea-ders>
		<!-- 搜索框 -->
		<view class="seach">
			<view class="seach_one">
				<image src="../../../static/shopImage/tb_search.png" mode="aspectFit"></image>
				<input type="text" value="" placeholder="编码/名称" />
			</view>
		</view>

		<uni-swipe-action>
			<uni-swipe-action-item v-for="(item,index) in swipeList" :options="item.options" :key="item.id" @change="swipeChange"
			 @click="swipeClick($event,index)">
				<!-- <text class="cont">{{item.content}}</text> -->
				<view class="warehouse_del">
					<view class="warehouse_del_one">
						<text>默认仓库 0001</text>
						<text>地址:</text>
					</view>
				</view>
			</uni-swipe-action-item>
		</uni-swipe-action>
	</view>
</template>

<script>
	import uniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue'
	import uniSwipeActionItem from '@/components/uni-swipe-action-item/uni-swipe-action-item.vue'
	import heaDers from '@/pages/header/header.vue'
	export default {
		components: {
			heaDers
		},
		data() {
			return {
				swipeList: [{
					id: 1,
					options: [{
						text: '删除',
						style: {
							backgroundColor: 'rgb(255,58,49)'
						}
					}],

				}]
			};
		},
		methods: {

			swipeChange(e) {
				console.log('返回：', e);
			},
			swipeClick(e, index) {
				let {
					content
				} = e
				if (content.text === '删除') {
					uni.showModal({
						title: '提示',
						content: '是否删除',
						success: (res) => {
							if (res.confirm) {
								this.swipeList.splice(index, 1)
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						}
					});
				}
			}
		}
	}
</script>

<style lang="scss">
.center{
	.title {
		width: 100%;
		height: 88rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
		background-color: rgba(36, 153, 246, 1);
		display: flex;
		justify-content: space-between;
		align-items: center;
		image {
	
			width: 22rpx;
		}
		text {
			font-size: 26rpx;
			color: #fff;
			font-weight: 400;
			font-family: PingFang SC;
			padding-left: 10rpx;
		}
		.ima {
			image {
				width: 40rpx;
				margin-left: 5rpx;
			}
		}
	}
	
	.seach {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx;
		background: #fff;
	
		.seach_one {
			display: flex;
			align-items: center;
			background: #F5F5F5;
			border-radius: 32rpx;
			width: 100%;
			padding: 10rpx;
		}
	}
	
	.seach image {
		width: 32rpx;
		height: 32rpx;
		padding: 0 10rpx 10rpx 0;
		margin-left: 10rpx;
	}
	
	.warehouse_del {
		border-bottom: 1px solid #F5F5F5;
		height: 88rpx;
		padding: 10rpx 20rpx;
		width: 100%;
		line-height: 40rpx;
	
		.warehouse_del_one text {
			font-size: 24rpx;
			color: #616161;
			display: block;
		}
	
	}
	
}
</style>
